package com.ubtechinc.cruzr.libai.honglauncher.down;


import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;

import com.liulishuo.okdownload.DownloadListener;
import com.liulishuo.okdownload.DownloadTask;
import com.liulishuo.okdownload.core.breakpoint.BreakpointInfo;
import com.liulishuo.okdownload.core.cause.EndCause;
import com.liulishuo.okdownload.core.cause.ResumeFailedCause;
import com.orhanobut.logger.Logger;

import java.util.List;
import java.util.Map;

public abstract class DownloadListenerSimple implements DownloadListener {
    @Override
    public void taskStart(@NonNull DownloadTask task) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： taskStart");
    }

    @Override
    public void connectTrialStart(@NonNull DownloadTask task, @NonNull Map<String, List<String>> requestHeaderFields) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： connectTrialStart");
    }

    @Override
    public void connectTrialEnd(@NonNull DownloadTask task, int responseCode, @NonNull Map<String, List<String>> responseHeaderFields) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： connectTrialEnd");
    }

    @Override
    public void downloadFromBeginning(@NonNull DownloadTask task, @NonNull BreakpointInfo info, @NonNull ResumeFailedCause cause) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： downloadFromBeginning");
    }

    @Override
    public void downloadFromBreakpoint(@NonNull DownloadTask task, @NonNull BreakpointInfo info) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： downloadFromBreakpoint");
    }

    @Override
    public void connectStart(@NonNull DownloadTask task, int blockIndex, @NonNull Map<String, List<String>> requestHeaderFields) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： connectStart");
    }

    @Override
    public void connectEnd(@NonNull DownloadTask task, int blockIndex, int responseCode, @NonNull Map<String, List<String>> responseHeaderFields) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： connectEnd");
    }

    @Override
    public void fetchStart(@NonNull DownloadTask task, int blockIndex, long contentLength) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： fetchStart");
    }

    @Override
    public void fetchProgress(@NonNull DownloadTask task, int blockIndex, long increaseBytes) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： fetchProgress");
    }

    @Override
    public void fetchEnd(@NonNull DownloadTask task, int blockIndex, long contentLength) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： fetchEnd");
    }

    @Override
    public void taskEnd(@NonNull DownloadTask task, @NonNull EndCause cause, @Nullable Exception realCause) {
//        Log.i("DownloadListenerSimple","DownloadListener  的状态： taskEnd");
        taskCompleted(task, cause, realCause);
    }

    public abstract void taskCompleted(@NonNull DownloadTask task, @NonNull EndCause cause, @Nullable Exception realCause);
}
